import request from '@/utils/request'

export function getGoodsList (params:any) {
    return request({
        url: 'store.goods/list',
        method: 'GET',
        params
    })
}

export function getGoodsSimpleList (params:any) {
    return request({
        url: 'store.goods/simpleList',
        method: 'GET',
        params
    })
}


export function createGoodsSpec (data:any) {
    return request({
        url: 'store.goods/createSpec',
        method: 'POST',
        data
    })
}
export function createGoods (data:any) {
    return request({
        url: 'store.goods/create',
        method: 'POST',
        data
    })
}
export function updateGoods (data:any) {
    return request({
        url: `store.goods/update`,
        method: 'PUT',
        data
    })
}
export function delGoods (data:{id:number|string}) {
    return request({
        url: `store.goods/delete`,
        method: 'DELETE',
        data
    })
}
export function destroyGoods (data:{id:number|string}) {
    return request({
        url: `store.goods/destroy`,
        method: 'DELETE',
        data
    })
}
export function updateStatusGoods (data:{id:number|string,status:number|string}) {
    return request({
        url: `store.goods/status`,
        method: 'PUT',
        data
    })
}

export function getGoodsDetail (params:{id:number|string}) {
    return request({
        url: `store.goods/detail`,
        method: 'GET',
        params
    })
}
